home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 27 / Mac Magazin and MacEasy Magazine CD - Issue 27.iso / System / Kontrollfelder / WDEFLeopard_1_2_1 / Read Me next >
Text File  |  1996-10-18  |  3KB  |  87 lines

  1. WDEF Leopard 1.2.1 
  2.  
  3. by Maf Vosburgh
  4. 18th of October 1996
  5.  
  6. Price Info
  7. WDEF Leopard is free.
  8. Share and enjoy.
  9.  
  10. Contact Info
  11. maf@mmcorp.com
  12. http://www.mmcorp.com/~maf
  13.  
  14.  
  15. Legal Info
  16. This software is supplied "As Is" without warranty of any kind, and the 
  17. author does not accept responsibility for any damage it might 
  18. accidentally cause. 
  19.  
  20. Info for Normal People
  21. There has been a lot of panic recently about the "WDEF crash" : system 
  22. error 87.
  23. To prevent this and other related crashes (84, 88 & 89) I wrote this control 
  24. panel.
  25. Just drag it to your Control Panels folder and restart.
  26. It installs a friendly "WDEF Leopard" who will try to guard your system 
  27. from harm with her powerful paws.
  28.  
  29. Info for Geeks
  30. As it turns out, WDEF resources shouldn't be purgeable.
  31. This is documented, but barely (as pointed out by Robert Thornton).
  32. Here is why they should not be purgeable- if the custom WDEF for a 
  33. window gets purged, and the Window Manager tries to redraw that window 
  34. while the app is in the background, it fails to reload the WDEF code, 
  35. because it calls LoadResource with the wrong current resource file.
  36. The Window Manager engineers could fix this by -
  37. a) inserting one line of code (a call to HNoPurge) in their code that 
  38. loads custom WDEFs, 
  39. or
  40. b) inserting a few lines of code around their call to LoadResource so 
  41. they use the right resource file
  42. or
  43. c) at least publicise the fact that WDEFs should not be purgeable.
  44. In the meantime, this INIT aims to fix the problem by briefly taking 
  45. control whenever an application is launched and marking the resources in 
  46. question non-purgeable. It does not save these changes to disk, so it 
  47. shouldn't cause problems with updaters, virus checkers, backup programs 
  48. etc.
  49. As long as the app doesn't explicitly do an HPurge on the these Handles, 
  50. everything should be fine.
  51. The initial version just scanned for WDEFs. This version takes things a 
  52. step further can also load MDEFs, MENUs and CDEFs. 
  53.  
  54. Revision History
  55. Version 1.0
  56. First release. 
  57.  
  58. Version 1.1
  59. I added MDEF, CDEF and MENU resources to the list of types to preload 
  60. and make unpurgeable.
  61. This has improved the robustness of certain programs considerably when 
  62. put to the standard test - switch to ZoneRanger, purge the heap of the 
  63. target app, then make it redraw while in the background.
  64.  
  65. Version 1.2 
  66. Made it into a Control Panel, so users can choose which resources are 
  67. preloaded. 
  68. Removed the option to preload MENUs, as this crashes ClarisWorks 4.0.
  69.  
  70. Version 1.2.1
  71. In line with various suggestions made by Robert Thornton, I changed the 
  72. strategy of the code - it now no longer preloads resources, just marks 
  73. them non-purgeable in the resource map. This is faster, uses less 
  74. memory, and also fixes the previous MENU conflict with ClarisWorks. That 
  75. has enabled me to reinstate the MENU protection feature (which protects 
  76. you from system error 84). The patch on _InitGraf is now a proper 
  77. head-patch (don't worry if you don't know what that means). 
  78.  
  79. Thanks to
  80. Robert Thornton for key information.
  81. Graham Bartram for the name.
  82. Dan Salmon for being the first tester.
  83. Binky and Kevin for being cool.
  84. Vik Rubenfeld for pointing the problem out on Usenet.
  85. Tracy Valleu, Troy Gaul, Robert Thornton and Ric Ford for other info.
  86.  
  87.